/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.inventario.dao;

import com.isd.global.dao.BaseDAO;
import com.isd.inventario.modelo.ItemBusquedaPredefinida;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;
import com.isd.inventario.modelo.Marca;
import com.isd.inventario.modelo.RubroPK;
import com.isd.inventario.vista.ItemCatalogo;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author ctrosch
 */
@Stateless
public class ItemBusquedaPredefinidaDAO extends BaseDAO{
    
    public List<ItemBusquedaPredefinida> getLista(){
        
        try {
            
            String sQuery = "SELECT i FROM ItemBusquedaPredefinida i ";
            sQuery += " WHERE i.debaja =  'N' ";
            sQuery += " ORDER BY i.orden ASC";

            Query q = getEntityManager().createQuery(sQuery);            
            return q.getResultList();

        } catch (Exception e) {

            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "getLista", e);            
            return new ArrayList<ItemBusquedaPredefinida>();
        }
    }

}
